package com.wjqy.controller;

import com.wjqy.entity.CommonReturnEntity;
import com.wjqy.entity.Item;
import com.wjqy.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ItemController {

    @Autowired
    private ItemService itemService;

    @RequestMapping("items")
    public CommonReturnEntity showItems(){
        List<Item> allItem = itemService.findAllItem();
        return CommonReturnEntity.success(allItem);
    }


}
